<template>
  <view>
    <text>使用子组件</text>
    <Child v-if="isShow" />
    <button type="button" @click="destroyButton">销毁组件</button>
  </view>
</template>

<script>
  import Child from './Child.vue'
  
  export default {
    data(){
      return {
        count: 1,
        isShow: true
      }
    },
    components: {
      Child
    },
    methods: {
      // 不显示组件
      destroyButton(){
        this.isShow = !this.isShow
      }
    }
  }
</script>

<style scoped>

</style>